-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(@angular/ssr): bundle Critters #28228
Conversation
f5950df
to
2001375
Compare
98b5dad
to
ec3823b
Compare
I can see that a decent chunk of this code was just moved around, so I tried not to comment too much on it. Feel free to ignore any pre-existing issues which should be out of scope for this PR. |
ec3823b
to
7a23311
Compare
17a0038
to
5d45ecd
Compare
c0ec7dc
to
14fa983
Compare
This commit bundles the Critters library to ensure compatibility with Nodeless environments. Additionally, all licenses for bundled libraries, including Critters, are now included in the package. This helps maintain compliance with open-source license requirements.
14fa983
to
108b9a7
Compare
This refactor adds a workaround to enable TypeScript declaration merging for the Critters class. We initially tried using interface merging on the default-exported Critters class: ```typescript interface Critters { embedLinkedStylesheet(link: PartialHTMLElement, document: PartialDocument): Promise<unknown>; } ``` However, since Critters is exported as a default class, TypeScript's declaration merging does not apply. To solve this, we introduced a new class, CrittersBase, which extends Critters, and added the required method in the CrittersBase interface: ```typescript interface CrittersBase { embedLinkedStylesheet(link: PartialHTMLElement, document: PartialDocument): Promise<unknown>; } class CrittersBase extends Critters {} ```
- Implemented functionality to compare and update third-party license files - Added handling for '--accept' argument to update the golden license file - Included tests to ensure the Critters license file matches the golden reference This update ensures license file consistency and provides an easy way to update the reference file when necessary.
108b9a7
to
b358248
Compare
b358248
to
d8d7c96
Compare
Leverage the built-in `diff_test` feature from Bazel to check for file changes. For details, see: https://github.com/bazelbuild/bazel-skylib/blob/main/docs/diff_test_doc.md
d8d7c96
to
1c70f47
Compare
@@ -29,7 +29,6 @@ | |||
"@angular/platform-server": "19.0.0-next.1", | |||
"@angular/router": "19.0.0-next.1", | |||
"@bazel/runfiles": "^5.8.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Would @bazel/runfiles
make more sense in the root package.json
? I'm kinda surprised it's not there already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out = "critters_license_file_accept.sh", | ||
content = | ||
[ | ||
"#!/usr/bin/env bash", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat trick with write_file
, didn't know it could create a binary like that.
One limitation here is that this will only work for Unix developers, not Windows devs. It's probably not a huge deal, especially since anyone could manually copy over the text, even if that is a bit annoying.
Maybe once we get on @aspect_rules_js
it might be worth making a more reusable and cross-platform golden_test
macro. I thought @aspect_bazel_lib
had something here, but it seems like their diff_test
isn't much smarter than Skylib's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could create a macro that creates a CMD instead a bash for Windows.
But as mentioned there are workaround, and likely the update of the golden will be done by one of team which at the moment use Linux or Mac.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This commit bundles the Critters library to ensure compatibility with Nodeless environments. Additionally, all licenses for bundled libraries, including Critters, are now included in the package. This helps maintain compliance with open-source license requirements.